From: Marco Trevisan (TreviƱo) Date: Thu, 18 Apr 2019 20:50:21 +0000 (-0500) Subject: CyclerPopup: Check for type using constructor X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~845^2^2~239 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3a3f9aa008e709e0a3c3535434efffb0231e4279;p=gnome-shell.git CyclerPopup: Check for type using constructor Classes that are sub-classes of GObject don't use a constructor per se, so we can't check for new.target (as this is undefined) in _init. Then compare the current constructor name instead. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/503 --- diff --git a/js/ui/altTab.js b/js/ui/altTab.js index fb9c875c8..0212992be 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -477,8 +477,8 @@ var CyclerList = GObject.registerClass({ var CyclerPopup = GObject.registerClass( class CyclerPopup extends SwitcherPopup.SwitcherPopup { _init() { - if (new.target === CyclerPopup) - throw new TypeError('Cannot instantiate abstract class ' + new.target.name); + if (this.constructor.name === CyclerPopup.prototype.constructor.name) + throw new TypeError(`Cannot instantiate abstract class ${this.constructor.name}`); super._init();